function openComDB(name, path) {  
	return  new Promise((resonlve,reject)={
		plus.sqlite.openDatabase({
		    name: name,  
		    path: path,  
		    success: (e)=> {  
		        plus.nativeUI.alert('打开数据库成功');  
		        resonlve(e)  
		    },  
		    fail: (e)=> {  
		        plus.nativeUI.alert("打开数据库失败");  
		        reject(e);  
		    }  
		})  
	})
    
}  

function executeSQL(name, sql) {  
		return  new Promise((resonlve,reject)={
			plus.sqlite.selectSql({  
				name: name,  
				sql: sql,  
				success: (e)=> {  
					console.log("查询数据库:" + name + ",表:" + sql + ";的");  
					// console.log(JSON.stringify(e));  
					resonlve(e);  
				},  
				fail: (e)=> {  
					console.log("查询数据库失败:" + JSON.stringify(e));  
					reject(e);  
				}  
			})  
		)}
}  

export{  
openComDB,  
executeSQL  
}